//
//  Macro.h
//  QVBusConductor
//
//  Created by Ting Han on 2017/9/1.
//  Copyright © 2017年 Ting Han. All rights reserved.
//

#ifndef Macro_h
#define Macro_h


//屏幕尺寸
#define kHTScreenWidth [UIScreen mainScreen].bounds.size.width
#define kHTScreenHeight [UIScreen mainScreen].bounds.size.height
#define kHTNavicationBarHeigth 44.0
#define kHTStatusBarHeight 20.0
#define kHTToolBarHeight 49.0
#define kHTNavicationBarAndStatusBar 64.0

//屏幕适配，比例适配,以7为基准
#define kHTWidthScale [UIScreen mainScreen].bounds.size.width/375.0
#define kHTHeightScale [UIScreen mainScreen].bounds.size.height/667.0
#define kHeight(y) kHTHeightScale*y
#define kWidth(x) kHTWidthScale*x


#define kApplicationStatusBarHeight  [UIApplication sharedApplication].statusBarFrame.size.height //状态栏的高度
#define IS_IPHONE_X     (kHTScreenWidth == 375.f && kHTScreenHeight == 812.f)
#define IPHONE_NAVIGATIONBAR_HEIGHT  (IS_IPHONE_X ? 88 : 64)
#define IPHONE_STATUSBAR_HEIGHT      (IS_IPHONE_X ? 44 : 20)
#define IPHONE_SAFEBOTTOMAREA_HEIGHT (IS_IPHONE_X ? 34 : 0)
#define IPHONE_TOPSENSOR_HEIGHT      (IS_IPHONE_X ? 32 : 0)

//color
#define HTColorFromRGB(rgbValue)  [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0  blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define HTColorRGB(r,g,b)  [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
#define HTColorRGBA(r,g,b,a)  [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]

//debug log
#ifdef DEBUG
#define DBLog(...) NSLog(@"%s(第%d行) %@", __PRETTY_FUNCTION__, __LINE__, [NSString stringWithFormat:__VA_ARGS__])
#else
#define DBLog(...)
#endif

//颜色
#define  kNaviBarColor  HTColorRGB(42,176,116)
#define kBackgroundColor [UIColor groupTableViewBackgroundColor]
#define kMainColor [UIColor blueColor]
#define kMainGrayColor [UIColor lightGrayColor]
#define kBlueColor HTColorFromRGB(0x4e9ffa)
#define kPurpleColor  HTColorFromRGB(0x8c86e6)
#define kGreenColor  HTColorFromRGB(0x69dca5)
//大小
#define kFooterHeight kWidth(60)

#define kAmapKey @"3e570785fdf50c8f710e9f868f80eef3"
#define kUmeKey @"59c8d8e975ca3508dc000186"

//网络请求
//#define BaseURL @"http://192.168.1.128/freight/public/api/v1/"
#define BaseURL @"http://hy.qvbus.com/api/v1/"
//Version Cargos/getcargosversion
#define requestCargoversion [NSString stringWithFormat:@"%@Cargos/getcargosversion",BaseURL]
#pragma mark --- 登陆
//验证码（司机端） driver/getmessage?phone=13126821937
#define requestSecurityCode  [NSString stringWithFormat:@"%@driver/getmessage",BaseURL]
//登陆 Cargps/loadin?phone=13126821937&yzm=5500
#define requestlogin [NSString stringWithFormat:@"%@Cargps/loadin",BaseURL]


#pragma mark --- 发货
//发布货源
#define requestDeliverGoods  [NSString stringWithFormat:@"%@produce/createproduce",BaseURL]
//货主发货列表
#define requestDeliverList  [NSString stringWithFormat:@"%@produce/getproducelist",BaseURL]
//获取货主详情界面
#define requestDeliverHolder  [NSString stringWithFormat:@"%@produce/getproduceinfor",BaseURL]
//货源信息状态变更
#define requestDeliverStateChange  [NSString stringWithFormat:@"%@produce/closerproduces",BaseURL]
//获取长发货源
#define requestDeliverFrequently  [NSString stringWithFormat:@"%@produce/getproduceoff",BaseURL]
//删除常发货源
#define requestDeliverFrequentlyDelete  [NSString stringWithFormat:@"%@produce/changeprocedstate",BaseURL]
//发布已发布过的货源
#define requestDeliverGoodsUsed  [NSString stringWithFormat:@"%@produce/createpubliproduct",BaseURL]
//获取货源信息
#define requestDeliverInfo  [NSString stringWithFormat:@"%@produce/getproductbyid",BaseURL]

#pragma mark --- 常用车辆部分
//添加常用车辆
#define requestTruckAdd  [NSString stringWithFormat:@"%@produce/createcaroffer",BaseURL]
//获取常用车辆列表
#define requestTruckList  [NSString stringWithFormat:@"%@produce/getcarofferlist",BaseURL]
//查询车辆
#define requestTruckListMap  [NSString stringWithFormat:@"%@produce/getcarstate",BaseURL]
//删除常用车辆
#define requestTruckDelete [NSString stringWithFormat:@"%@produce/deletcaroffer",BaseURL]
//搜索司机
#define requestTruckDriver [NSString stringWithFormat:@"%@produce/searchephone",BaseURL]
//获取司机主页
#define requestTruckDriverInfor [NSString stringWithFormat:@"%@produce/getdriveripage",BaseURL]
//获取司机信息
#define requestTruckDriverCarInfo [NSString stringWithFormat:@"%@produce/getcarinfor",BaseURL]

#pragma mark --- 订阅线路
//添加订阅线路
#define requestOrderlineAdd [NSString stringWithFormat:@"%@produce/createcargosbooks",BaseURL]
//删除订阅线路
#define requestOrderlineDelete [NSString stringWithFormat:@"%@produce/deletcargoline",BaseURL]
//获取订阅线路列表
#define requestOrderlineList  [NSString stringWithFormat:@"%@produce/getcargobookslist",BaseURL]
//根据订阅线路查询货源
#define requestOrderlineSearch  [NSString stringWithFormat:@"%@produce/getallcargobooks",BaseURL]

#pragma mark --- 货源搜索

//货源搜索
#define requestGoodsSearch [NSString stringWithFormat:@"%@produce/getcargoslist",BaseURL]
//货源详情 produce/getcargosinfor?token=3bda6a196bb1f033361c5fc67534dfca&productid=5
#define requestGoodsDetial [NSString stringWithFormat:@"%@produce/getcargosinfor",BaseURL]
//货主主页
#define requestHolderInfo [NSString stringWithFormat:@"%@produce/getproducts",BaseURL]


#pragma mark --- 运单
//运单列表
#define requestWaybillList [NSString stringWithFormat:@"%@produce/getcargoorderlist",BaseURL]
//确认收货
#define requestWaybillConformReceived [NSString stringWithFormat:@"%@produce/changeorderstate",BaseURL]
//运单详情
#define requestWaybillDetial [NSString stringWithFormat:@"%@produce/getorderinfor",BaseURL]
//评论
#define requestWaybillComment [NSString stringWithFormat:@"%@produce/createcontens",BaseURL]
//取消订单
#define requestWaybillCancle [NSString stringWithFormat:@"%@produce/cancleorders",BaseURL]
//货主确认订单
#define requestWaybillHolderConform [NSString stringWithFormat:@"%@produce/canok",BaseURL]

#pragma mark --- 个人信息
//认证
#define requestUserRegister [NSString stringWithFormat:@"%@Cargos/regist",BaseURL]
//图片上传
#define requestUploadUserspic  [NSString stringWithFormat:@"%@driver/updatepic",BaseURL]
//货主信息
#define requestUserInfo  [NSString stringWithFormat:@"%@Cargos/cargopage",BaseURL]
//货主信息详情
#define requestUserInfoDetial  [NSString stringWithFormat:@"%@Cargos/cargoinfors",BaseURL]

//注册友盟
#define requestNotificationRegister  [NSString stringWithFormat:@"%@driver/regitymeng",BaseURL]

//我的信息
#define requestUserMessage  [NSString stringWithFormat:@"%@user/getmessage",BaseURL]
//上传地理信息
#define requestPostAddress  [NSString stringWithFormat:@"%@user/updatelat",BaseURL]
//获取车辆位置
#define requestGetAddress  [NSString stringWithFormat:@"%@user/getcarstatelist",BaseURL]


#endif /* Macro_h */
